import request from '@/utils/request'

// 查询投诉工单列表
export function listComplaints(query) {
  return request({
    url: '/oa/complaints/list',
    method: 'get',
    params: query
  })
}

// 查询投诉工单详细
export function getComplaints(id) {
  return request({
    url: '/oa/complaints/' + id,
    method: 'get'
  })
}

// 新增投诉工单
export function addComplaints(data) {
  return request({
    url: '/oa/complaints',
    method: 'post',
    data: data
  })
}

// 受理投诉工单
export function applyComplaints(data) {
  return request({
    url: '/oa/complaints/applyComplaints',
    method: 'post',
    data: data
  })
}
// 处理投诉
export function handleComplaints(data) {
  return request({
    url: '/oa/complaints/handleComplaints',
    method: 'post',
    data: data
  })
}
// 客户评价投诉工单
export function doComplaintsScore(data) {
  return request({
    url: '/oa/complaints/doComplaintsScore',
    method: 'post',
    data: data
  })
}
// 物业回访投诉工单
export function doComplaintsVisit(data) {
  return request({
    url: '/oa/complaints/doComplaintsVisit',
    method: 'post',
    data: data
  })
}
/**
 * 撤销
 * @param id 工单ID
 */
export function doCancel(id) {
  return request({
    url: '/oa/complaints/doCancel/'+id,
    method: 'post',
  })
}

